/***********************************************************************
 * Module:  PuissanceFiscale.java
 * Author:  a.kanwar
 * Purpose: Defines the Class PuissanceFiscale
 ***********************************************************************/

import java.util.*;

public class PuissanceFiscale {

      
   /********************************************************************
    * Attribute
    *********************************************************************/
    
   private int idPuissance;
   private java.lang.String libelle;
   private java.util.Collection<Vehicule> vehicule;

    /********************************************************************
     * Constructor
     *********************************************************************/
    public PuissanceFiscale(int idPuissance, String libelle, Collection<Vehicule> vehicule) {
        this.idPuissance = idPuissance;
        this.libelle = libelle;
        this.vehicule = vehicule;
    }

    public PuissanceFiscale(String libelle, Collection<Vehicule> vehicule) {
        this.libelle = libelle;
        this.vehicule = vehicule;
    }

   
   
      
   /********************************************************************
    * getters and setters
    *********************************************************************/
    
   public int getIdPuissance() {
      return idPuissance;
   }

    public void setIdPuissance(int idPuissance) {
        this.idPuissance = idPuissance;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    @Override
    public String toString() {
        return "PuissanceFiscale{" + "idPuissance=" + idPuissance + ", libelle=" + libelle + ", vehicule=" + vehicule + '}';
    }

   
    
      
   /********************************************************************
    * generate code by power AMC
    *********************************************************************/
   public java.util.Collection<Vehicule> getVehicule() {
      if (vehicule == null)
         vehicule = new java.util.HashSet<Vehicule>();
      return vehicule;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorVehicule() {
      if (vehicule == null)
         vehicule = new java.util.HashSet<Vehicule>();
      return vehicule.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newVehicule */
   public void setVehicule(java.util.Collection<Vehicule> newVehicule) {
      removeAllVehicule();
      for (java.util.Iterator iter = newVehicule.iterator(); iter.hasNext();)
         addVehicule((Vehicule)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newVehicule */
   public void addVehicule(Vehicule newVehicule) {
      if (newVehicule == null)
         return;
      if (this.vehicule == null)
         this.vehicule = new java.util.HashSet<Vehicule>();
      if (!this.vehicule.contains(newVehicule))
      {
         this.vehicule.add(newVehicule);
         newVehicule.setPuissanceFiscale(this);      
      }
   }
   
   /** @pdGenerated default remove
     * @param oldVehicule */
   public void removeVehicule(Vehicule oldVehicule) {
      if (oldVehicule == null)
         return;
      if (this.vehicule != null)
         if (this.vehicule.contains(oldVehicule))
         {
            this.vehicule.remove(oldVehicule);
            oldVehicule.setPuissanceFiscale((PuissanceFiscale)null);
         }
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllVehicule() {
      if (vehicule != null)
      {
         Vehicule oldVehicule;
         for (java.util.Iterator iter = getIteratorVehicule(); iter.hasNext();)
         {
            oldVehicule = (Vehicule)iter.next();
            iter.remove();
            oldVehicule.setPuissanceFiscale((PuissanceFiscale)null);
         }
      }
   }

}